package com.easy.common.enumbean;

import com.baomidou.mybatisplus.annotation.EnumValue;
import com.fasterxml.jackson.annotation.JsonCreator;

public enum RoleStatus {
    //启用，停用
    NORMAL("启用"),DISABLE("停用");
    @EnumValue
    private String value;
    private RoleStatus(String value){
        this.value=value;
    }
    @JsonCreator
    public RoleStatus convert(String val){
        switch (val){
            case "启用":
                return NORMAL;
            case "停用":
                return DISABLE;
            default:
                throw new RuntimeException("没有对应的枚举类型");
        }
    }

    public String valueOf(){
        return this.value;
    }
    public String toString(){
        return this.value;
    }
}
